package org.example.Day3.niming;


public class Test {
    public static void main(String[] args) {
        Swimming s1 = new Swimming() {
            @Override
            public void swim() {
                System.out.println("狗刨飞快");
            }
        };
        go(s1);
        Swimming s2 = new Swimming() {
            @Override
            public void swim() {
                System.out.println("猴子游泳也还行");

            }
        };
        go(s2);
    }
        public static void go(Swimming s){
            System.out.println("开始---------");
            s.swim();
            System.out.println("结束---------");

    }
}
